From: Mario Sanchez Prada Date: Wed, 22 Apr 2015 22:00:16 +0000 (+0100) Subject: misc: Add missing check on reply from systemd's CanSuspend D-Bus method X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1373 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=be78f0f36a17a45f44b7c6723138d3e02944ee8d;p=gnome-shell.git misc: Add missing check on reply from systemd's CanSuspend D-Bus method According to systemd logind's documentation, the CanSuspend() method "returns 'na' in case "the operation is not available because hardware, kernel or drivers do not support it", while "'no' is returned if the operation is available but the user is not allowed to execute it". See http://www.freedesktop.org/wiki/Software/systemd/logind Thus, we need to return true here when the reply for the CanSuspend method is neither 'no' nor 'na', or we would providing false positives in cases where suspension is simply unsupported. https://bugzilla.gnome.org/show_bug.cgi?id=748338 --- diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index b4ed4a6a3..6ed826226 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -134,7 +134,7 @@ const LoginManagerSystemd = new Lang.Class({ if (error) asyncCallback(false); else - asyncCallback(result[0] != 'no'); + asyncCallback(result[0] != 'no' && result[0] != 'na'); }); },